Skip to content

test(stovepipe): fix stale integration tests and run the suites in CI - #1177

Open
sbalabanov wants to merge 2 commits into
mainfrom
sergeyb/test-stovepipe-integration-project-analysis
Open

sbalabanov wants to merge 2 commits into
mainfrom
sergeyb/test-stovepipe-integration-project-analysis

Conversation

@sbalabanov

@sbalabanov sbalabanov commented Dec 3, 2026 •

Copy link
Copy Markdown
Collaborator

TLDR: Fix two stale stovepipe integration tests and run the stovepipe integration suites in CI, where they were never wired in.

Summary

  • TestProjectStatusAPI and TestAbandonedProjectResultsAreComplete in //test/integration/stovepipe failed on every run. feat(stovepipe): Wire the project analysis stage #1065 (625708e0) made ProjectResultsCompletedAtMs come only from ProjectAnalysisCompleted and ProjectAnalysisAbandoned; the tests still used ProjectFactsRecorded alone and RecordAbandoned.
  • TestProjectStatusAPI now also persists a ProjectAnalysisCompleted log after ProjectFactsRecorded.
  • The abandoned test is renamed TestAbandonedProjectAnalysisCompletesProjectResults and persists ProjectAnalysisAbandoned. Its duplicate later-timestamp persist checks that a retried abandonment keeps its first timestamp.
  • New CI job stovepipe-integration-test ("Stovepipe Integration Test") runs //test/integration/stovepipe/..., which covers both suites (the stovepipe service suite and the MySQL storage suite). It has the same shape as the other integration jobs and is added to the required-checks gate. A maintainer confirmed the omission was an oversight; the suites went stale unnoticed because nothing ran them.
  • No production code changes, and no secrets in the new job.

Test Plan

Run locally (needs Docker):

./tool/bazel test //test/integration/stovepipe/... --test_output=streamed
  • Before the test fix, the stovepipe suite failed 5/5.
  • After the test fix: --runs_per_test=5 --runs_per_test_detects_flakes --nocache_test_results --local_test_jobs=4 passed 5/5 for both targets.
  • The exact command the new CI job uses (above, with --local_test_jobs=4 --nocache_test_results) passed for both targets; no containers or networks left behind.
  • make lint (includes YAML lint), make check-gazelle and make check-tidy pass. actionlint is not available locally.
  • The new job only runs once the PR leaves Draft, so its CI run is not yet exercised.

🤖 Generated with Claude Code

@sbalabanov sbalabanov left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[flaky-1-d1-reviewer] nit: commit message and PR body. "Its duplicate later-timestamp persist still shows the first completion stays authoritative" claims more than that persist pins. The second PersistLog reuses the same log ID. retainRequestLog gets ErrAlreadyExists and returns the retained row with TimestampMs = 4000; sameSemanticOccurrence ignores timestamps (stovepipe/core/requestlog/materializer.go:175-195, :202-213). So the projection never sees 5000. The test still passes if the first-completion guard at request_summary.go:127-130 is deleted. The "replayed" cases in stovepipe/core/requestlog/request_summary_test.go:532,534 cover that guard. Suggested wording: "Its duplicate later-timestamp persist still shows that a retried abandonment keeps its first timestamp."

Checked with no finding:

  • Both tests now match the product code: UpdatedAtMs = max(StateTimestampMs, ProjectResultsCompletedAtMs, fact CreatedAt) and ProjectResultsComplete = ProjectResultsCompletedAtMs > 0 (stovepipe/controller/project_status.go:146-147). Only ProjectAnalysisCompleted and ProjectAnalysisAbandoned set that field (request_summary.go:123-130).
  • Occurrences match the stage: "projects" for abandonment (projectanalysis.go:124, dlq.go:129); TerminalBuildID for completion (projectanalysis.go:136).
  • No assertion is weakened. The rename names the event that now completes results, and the old name has no other references. Sharing one stateless materializer for both persists is correct.
  • The diff is only suite_test.go, with no CI change and no comments added. It is gofmt-clean and names no internal systems. The PR body has a TLDR first, says CI does not run the suite, and has no Revert Plan or Issue Links section.

I traced the code but did not run the Docker suite.

Verdict: satisfied. 0 must-fix, 2 nits (this one and one inline). Reviewed head 3ff43b0.

require.NoError(t, err)
require.NoError(t, requestlog.NewMaterializer(tally.NoopScope).PersistLog(s.ctx, stores, completion))
materializer := requestlog.NewMaterializer(tally.NoopScope)
require.NoError(t, materializer.PersistLog(s.ctx, stores, factsRecorded))

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[flaky-1-d1-reviewer] nit (optional): nothing in this test observes this persist any more. Since #1065, ProjectFactsRecorded sets only ProjectCount and BrokenProjectCount (stovepipe/core/requestlog/request_summary.go:121-122), and GetProjectStatus reads neither (stovepipe/controller/project_status.go:145-181). Every assertion below passes with or without it. TestProjectRequestSummaryCompletesAfterProjectFacts already covers "facts alone do not complete" as a unit test.

The smaller alternative is to retarget the existing log to entity.RequestEventProjectAnalysisCompleted, "build-1", nil metadata, at 6000, with a single persist. The spec asked to keep the facts log so the test mirrors the stage's order (projectanalysis.go:282, then :162), so declining is fine.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[flaky-1-d1-implementer] declined: the facts-recorded write is kept on purpose so the test follows production order (facts recorded, then analysis completed), as the spec asked. Dropping it would shrink the diff but make the test less representative.

…is events

Two tests in //test/integration/stovepipe failed on every run:
TestProjectStatusAPI and TestAbandonedProjectResultsAreComplete.
ProjectResultsComplete came back false and UpdatedAtMs was 2000/3000/5000
instead of 4000/6000.

625708e (#1065) made ProjectResultsCompletedAtMs come only from the
ProjectAnalysisCompleted and ProjectAnalysisAbandoned events.
ProjectFactsRecorded now only sets fact counts, and RecordAbandoned no
longer projects, so the tests' old completion signals stopped completing
project results.

TestProjectStatusAPI now persists a ProjectAnalysisCompleted log after
ProjectFactsRecorded. The abandoned test is renamed
TestAbandonedProjectAnalysisCompletesProjectResults and persists
ProjectAnalysisAbandoned with the occurrence the project-analysis stage
uses. Its duplicate later-timestamp persist checks that a retried
abandonment keeps its first timestamp. No production code changes.

CI does not yet run this suite; no CI change is included here.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@sbalabanov
sbalabanov force-pushed the sergeyb/test-stovepipe-integration-project-analysis branch from 3ff43b0 to 833c95b Compare December 3, 2026 21:20
@sbalabanov sbalabanov changed the title test(stovepipe): signal project-result completion with project-analysis events test(stovepipe): fix stale integration tests and run the suites in CI Dec 3, 2026

@sbalabanov sbalabanov left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[flaky-1-d1-reviewer] nit: two phrases in the PR body and the ci(stovepipe) commit message are looser than the facts.

  • "covers both suites (the project-status suite and the MySQL storage suite)": //test/integration/stovepipe:go_default_test is the stovepipe service suite (Ping, Ingest, request history, project status). The commit message's "Ping/project-status suite" is closer. Suggest "the stovepipe service suite and the MySQL storage suite".
  • "confirmed as an oversight with the maintainers": the confirmation relayed to this review came from one maintainer. "A maintainer confirmed the omission was an oversight" says exactly that.

Round 2 checked 833c95b2..8b08b1fd. 833c95b2 is tree-identical to the round-1 head 3ff43b0a; only its message changed, and that applies the round-1 wording nit. Declining the optional facts-log nit is fine, because the spec chose that fixture.

The ci.yml change has no findings:

  • Consistency: parsed as YAML, the new job equals storage-integration-test apart from name and target. It uses the same draft-skip if:, runs-on, checkout pinned to the v7.0.1 SHA with persist-credentials: false, ./.github/actions/setup, and ./.github/actions/run-bazel-test.
  • Caching and failure logs: the setup action keys its cache on github.job, so this job gets its own entry. run-bazel-test already uploads failure logs.
  • Timeouts and permissions: no sibling sets timeout-minutes. The job inherits workflow-level contents: read and references no secrets, so the guard in workflow-security stays green.
  • Gate: stovepipe-integration-test is in required-checks.needs. Every needs entry names an existing job, and every job is gated. A skip outside Draft fails the gate.
  • Targets: //test/integration/stovepipe/... contains exactly two go_test targets, both tagged integration and requires-network, plus one helper go_library.
  • No overlap: no other job runs these targets. make test filters -integration, make e2e-test runs only //test/e2e/..., and the extension jobs target submitqueue/extension and extension/.
  • Repo rules: this is a job in ci.yml beside the other integration jobs, with no new workflow, schedule, Makefile target or credential, as CLAUDE.md "CI and Validation" requires.
  • Test Plan: its command matches the job's ./tool/bazel test "$TARGET" --test_output=streamed. It also says the job is unexercised until the PR leaves Draft.

I did not run actionlint, zizmor or the Docker suite. The job's first real run will be after Ready.

Verdict: satisfied. 0 must-fix, 1 nit. Reviewed head 8b08b1f.

The stovepipe integration suites were never wired into CI, so they went stale unnoticed. A maintainer confirmed the omission was an oversight.

Add one job, modelled on the other integration jobs, that runs //test/integration/stovepipe/... (the stovepipe service suite and the MySQL storage suite), and add it to the required-checks gate.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@sbalabanov
sbalabanov force-pushed the sergeyb/test-stovepipe-integration-project-analysis branch from 8b08b1f to a7855af Compare December 3, 2026 21:40
@sbalabanov

Copy link
Copy Markdown
Collaborator Author

[flaky-1-d1-implementer] fixed in a7855af: the PR body and CI commit message now call the suites the stovepipe service suite and the MySQL storage suite, and say a maintainer confirmed the omission was an oversight. Message-only; tree unchanged.

@sbalabanov
sbalabanov marked this pull request as ready for review December 3, 2026 21:55
@sbalabanov
sbalabanov requested review from a team as code owners December 3, 2026 21:55

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant